<template>
  <jl-base>

    <jl-header>
      <mt-header title="交资料明细" :fixed="true">
        <i slot="left">
          <mt-button icon="back" @click="back"></mt-button>
        </i>
      </mt-header>
    </jl-header>

    <jl-content>
      <mt-navbar v-model="selected">
        <mt-tab-item id="base">基本信息</mt-tab-item>
        <mt-tab-item id="goods">商品信息</mt-tab-item>
      </mt-navbar>


      <mt-tab-container v-model="selected">
        <mt-tab-container-item id="base">

          <div class="w12">
            <div class="dld_body mt10">
              <jl-from-input label="登录单" disabled v-model="list.GCDLD01"/>
              <jl-from-input label="经销商" disabled v-model="list.JXSMC"/>
              <jl-from-input label="合同签订时间" disabled v-model="list.HTQDRQ"/>
              <jl-from-input label="竣工时间" disabled v-model="list.JGSJ"/>
              <jl-from-input label="收单时间" disabled v-model="list.SDSJ"/>
              <jl-images label="发票照片" :icoShow="false" :value="list.FJFPZP"/>
              <jl-images label="工程照片" :icoShow="false" :value="list.FJGCZP" :preview="2"/>
              <jl-images label="验收明细照片" :icoShow="false" :value="list.YSMXBZP" :preview="3"/>
              <jl-images label="竣工审核照片" :icoShow="false" v-model="list.JGYSSHB" :preview="4"/>
              <jl-from-input label="资料审核编号" disabled v-model="list.ZLSHBH"/>
            </div>

            <div class="dld_body mt10">
              <jl-from-input label="用户联系人" disabled v-model="list.YHXM"/>
              <jl-from-input label="用户手机" disabled v-model="list.YHDH"/>
              <jl-from-input label="联系固定电话" disabled v-model="list.LXDH"/>
              <jl-from-textarea placeholder="备注" v-model="list.BZ"/>
            </div>
          </div>

        </mt-tab-container-item>


        <mt-tab-container-item id="goods">
          <div>
            <template v-for="(item,index) in list.SPLB">
              <div class="w12">
                <div class="dld_title"><span>商品信息({{index+1}})</span>
                </div>
                <div class="dld_body">
                  <div class="jl_form">
                    <div class="jl_form_item bor_bottom">
                      <span class="w04"><em class="font_red">*</em>分销单号</span>
                      <span class="w08 tr">{{item['JLWBDH']}}</span>
                    </div>
                  </div>
                  <div class="jl_form">
                    <div class="jl_form_item bor_bottom">
                      <span class="w04"><em class="font_red">*</em>商品名称</span>
                      <span class="w08 tr">{{item['GCSPMC']}}</span>
                    </div>
                  </div>
                  <div class="jl_input">
                    <div class="jl_input_item pr10 bor_bottom">
                      <span class="w08">
                        <em class="font_red">*</em>申请数量
                      </span>
                      <nut-stepper
                        :value.sync="item.BCZLSL"
                        :min="1"
                      ></nut-stepper>
                    </div>
                  </div>
                  <div class="jl_form">
                    <div class="jl_form_item bor_bottom">
                      <span class="w03">批复单价:</span>
                      <span class="w03">{{item['PFDJ'] | money }} </span>
                      <span class="w03">批复金额:</span>
                      <span class="w03">{{item['PFJE'] | money}}</span>
                    </div>
                  </div>
                </div>
              </div>
            </template>
          </div>
        </mt-tab-container-item>
      </mt-tab-container>

    </jl-content>
  </jl-base>
</template>

<script>
  export default {
    data() {
      return {
        selected: 'base',
        jlbh: '',
        dbdbh: '',
        list: {}
      }
    },
    methods: {
      back() {
        this.$router.back()
      },
      initData() {
        this.http.find("SCM_GCJZL", {
          bdbh: this.bdbh,
          jlbh: this.jlbh,
        })
          .then(v => {
            if ($Utils.isNull(v)) return;
            this.list = Object.assign({}, this.list, v[0]);
            this.$previewRefresh()
          })
      }
    },
    created() {
      if ($Utils.isNull(this.$route.params.item)) return
      this.jlbh = this.$route.params.item['JLBH'];
      this.bdbh = this.$route.params.item['BDBH'];
      this.initData()
    },
  }
</script>

<style scoped>

</style>
